home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 15
/
Aminet 15 - Nov 1996.iso
/
Aminet
/
text
/
dtp
/
SetTabs102.lha
/
SetTabs102.rexx
< prev
Wrap
OS/2 REXX Batch file
|
1996-09-25
|
2KB
|
95 lines
/*-----------------------------------*/
/* $VER: SetTabs V1.02 (25 Sep 1996) */
/* ©1996 Michael Merkel */
/*-----------------------------------*/
OPTIONS RESULTS
/* Make sure rexx support is opened */
IF ~SHOW('L','rexxsupport.library') THEN
CALL ADDLIB('rexxsupport.library',0,-30)
IF ~SHOW('L','softlogik:libs/slarexxsupport.library') THEN
CALL ADDLIB('softlogik:libs/slarexxsupport.library',0,-30)
ADDRESS 'PAGESTREAM'
'GETCURSOR TYPE objtype'
if RC>0 | objtype='TEXTOBJ' then
call DOERRORREQUESTER
measure = 'pt'
tabnum = 10
tabdist = '1cm'
firsttab = '1cm'
call DOREQUESTER
if ergebnis = cancelhandler THEN EXIT
delta = p2d(tabdist,measure)
first = p2d(firsttab,measure)
/* ---------------------------------------------------------------- */
'REFRESH OFF'
'SELECTTEXT ALL'
placestring = ''
do num = 0 to tabnum-1
pos = first + num*delta
placestring = placestring' LEFT 'pos''measure
end
'SETTABRULER 'placestring
call CLEANUP(1)
DOREQUESTER:
'ALLOCAREXXREQUESTER "SetTabs V1.02 - ©1996 Michael Merkel" 320 100'
reqhandle = RESULT
'ADDAREXXGADGET 'reqhandle' EXIT 10 80 70 LABEL "_Ok"'
okhandler = RESULT
'ADDAREXXGADGET 'reqhandle' EXIT 240 80 70 LABEL "_Cancel"'
cancelhandler = RESULT
'ADDAREXXGADGET 'reqhandle' STRING 250 10 50 STRING "'tabnum'" LABEL "place how many tabulators: "'
tabnum_gadget = RESULT
'ADDAREXXGADGET 'reqhandle' STRING 250 30 50 STRING "'tabdist'" LABEL "distance between tabulators:"'
tabdist_gadget = RESULT
'ADDAREXXGADGET 'reqhandle' STRING 250 50 50 STRING "'firsttab'" LABEL "position of first tabulator:"'
firsttab_gadget = RESULT
'DOAREXXREQUESTER 'reqhandle
ergebnis = RESULT
'GETAREXXGADGET 'reqhandle' 'tabnum_gadget' STRING'
tabnum = RESULT
'GETAREXXGADGET 'reqhandle' 'tabdist_gadget' STRING'
tabdist = RESULT
'GETAREXXGADGET 'reqhandle' 'firsttab_gadget' STRING'
firsttab = RESULT
'FREEAREXXREQUESTER 'reqhandle
RETURN
DOERRORREQUESTER:
say 'Error: Not in textbox/textframe!'
'ALLOCAREXXREQUESTER "Error!" 390 50'
reqhandle = RESULT
'ADDAREXXGADGET 'reqhandle' EXIT 160 30 70 LABEL "_Ok"'
dummy = RESULT
'ADDAREXXGADGET 'reqhandle' TEXT 10 10 370 STRING "Please place cursor in a textbox or textframe!"'
'DOAREXXREQUESTER 'reqhandle
dummy = RESULT
'FREEAREXXREQUESTER 'reqhandle
exit
RETURN
CLEANUP:
'REFRESH ON'
'REFRESHWINDOW'
EXIT